Skip to content

macs: replace deprecated activate-user with darwin-rebuild activate in MDM bootstrap#1079

Open
Senthil455 wants to merge 2 commits into
NixOS:mainfrom
Senthil455:main
Open

macs: replace deprecated activate-user with darwin-rebuild activate in MDM bootstrap#1079
Senthil455 wants to merge 2 commits into
NixOS:mainfrom
Senthil455:main

Conversation

@Senthil455

Copy link
Copy Markdown

Summary

The activate-user script is deprecated in nix-darwin and will be removed in 25.11. The mac-update script already uses darwin-rebuild switch which is correct, but the Mosyle MDM bootstrap process used a manual sequence:

systemConfig="$(readlink -f ./result)"
nix-env -p /nix/var/nix/profiles/system --set "$systemConfig"
"$systemConfig/activate-user"   # deprecated - will be removed in 25.11
"$systemConfig/activate"

Changes

macs/mdm-bootstrap.sh (new)

A dedicated bootstrap script for MDM-provisioned Mac builders that:

  • Replaces the legacy activate-user + activate sequence with darwin-rebuild activate
  • Falls back to legacy activation (with deprecation warning) if darwin-rebuild is not found
  • Includes input validation (root check, ./result existence check)
  • Handles both pre- and post-user-activation configurations correctly

macs/README.md (updated)

  • Added a new MDM Bootstrap section documenting the bootstrap flow
  • References mdm-bootstrap.sh with usage example

Context

Fixes #1043

@Senthil455 Senthil455 requested a review from a team as a code owner June 16, 2026 05:38
…n MDM bootstrap

The activate-user script is deprecated in nix-darwin and will be removed in 25.11.
The deprecation warning advises using darwin-rebuild activate instead, which
handles both user and system activation.

This change:
- Adds mdm-bootstrap.sh, a proper bootstrap script for MDM-provisioned
  Mac builders that uses darwin-rebuild activate instead of the legacy
  activate-user + activate sequence
- Updates the macs/README.md with MDM bootstrap documentation

Fixes NixOS#1043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MDM bootstrap: activate-user is deprecated and will be removed

1 participant